package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpb "gitee.com/cloudapex/protos/crm_message/pb"
	"google.golang.org/grpc"
)

var Compy compy

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_NOTIFY, func(c *grpc.ClientConn) {
		Compy.cli = gpb.NewCommpayNoticeClient(c)
	})
}

type compy struct {
	cli gpb.CommpayNoticeClient
}

func (this *compy) GetList(ctx context.Context, in *gpb.CmpNoticeListReq) (*gpb.CmpNoticeListRes, error) {
	return this.cli.CmpNoticeList(ctx, in)
}

func (this *compy) Add(ctx context.Context, in *gpb.CmpNoticeCreateReq) (*gpb.CmpNoticeCreateRes, error) {
	return this.cli.CmpNoticeCreate(ctx, in)
}
func (this *compy) Info(ctx context.Context, in *gpb.CmpNoticeCreateReq) (*gpb.CmpNoticeCreateRes, error) {
	return this.cli.CmpNoticeSelect(ctx, in)
}

func (this *compy) UpdateStatus(ctx context.Context, in *gpb.CmpNoticeStatusReq) (*gpb.CmpNoticeCreateRes, error) {
	return this.cli.CmpNoticeUpdateStatus(ctx, in)
}

func (this *compy) Update(ctx context.Context, in *gpb.CmpNoticeCreateReq) (*gpb.CmpNoticeCreateRes, error) {
	return this.cli.CmpNoticeUpdate(ctx, in)
}
